import { CACHE_MANAGER, Controller, Get, Inject } from '@nestjs/common';
import { AppService } from './app.service';

import { ConfigService } from '@nestjs/config';
import console from 'console';
import { Cache } from 'cache-manager';
import { Logger } from './common/logger/logger';

@Controller()
export class AppController {
  constructor(
    @Inject(CACHE_MANAGER) private cacheManager: Cache,
    private configService: ConfigService,
  ) {}

  @Get()
  async getHello() {
    const value: string = await this.cacheManager.get<string>('my-string');
    Logger.info(value);
    return value;
  }
}
